Saltar al contenido principal

Clase: Historial de Navegación

Clase: Historial de Navegación

Administrar una lista de entradas de navegación, representando el historial de navegación del usuario dentro de la aplicación.

Process: Main
This class is not exported from the 'electron' module. Sólo está disponible como un valor de retorno de otros métodos en la API de Electron.

Cada entrada de navegación corresponde a una página específica. El sistema de indexación sigue un orden secuencial, donde la primera entrada de navegación disponible es en el índice 0, representando la primera página visitada, y la última entrada de navegación es en índice N, representando la página más reciente. Mantener esta lista ordenada de entradas de navegación permite una navegación sin problemas tanto hacia atrás como hacia adelante a través del historial de navegación del usuario.

Métodos de Instancia

Returns boolean - Whether the browser can go back to previous web page.

Returns boolean - Whether the browser can go forward to next web page.

  • offset Integer

Returns boolean - Whether the web page can go to the specified offset from the current entry.

Borra el historial de navegación.

Devuelve Integer - El índice de la página actual, desde la cual volveríamos/adelante o recargar.

  • índice Entero

Returns NavigationEntry - Navigation entry at the given index.

Si el índice está fuera de límites (mayor que la longitud de la historia o menor que 0), se devolverá nulo.

Hace que el navegador regrese a una página web.

Hace que el navegador avance a una página web.

  • índice Entero

Navega al índice de página web absoluta especificado.

  • offset Integer

Navigates to the specified offset from the current entry.

Devuelve Integer - Longitud del historial.

  • índice Entero

Removes the navigation entry at the given index. Can't remove entry at the "current active index".

Returns boolean - Whether the navigation entry was removed from the webContents history.

Returns NavigationEntry[] - WebContents complete history.

Restores navigation history and loads the given entry in the in stack. Will make a best effort to restore not just the navigation stack but also the state of the individual pages - for instance including HTML form values or the scroll position. It's recommended to call this API before any navigation entries are created, so ideally before you call loadURL() or loadFile() on the webContents object.

This API allows you to create common flows that aim to restore, recreate, or clone other webContents.

  • options Object
    • entries NavigationEntry[] - Result of a prior getAllEntries() call
    • index Integer (optional) - Index of the stack that should be loaded. If you set it to 0, the webContents will load the first (oldest) entry. If you leave it undefined, Electron will automatically load the last (newest) entry.

Returns Promise<void> - the promise will resolve when the page has finished loading the selected navigation entry (see did-finish-load), and rejects if the page fails to load (see did-fail-load). Un manejador de rechazo noop ya esta adjunto, el cual evita errores de rechazo no controlados.